# -*- coding: utf-8 -*-
# coding=utf-8
import os
import shutil
import sys
import time

reload(sys)
sys.setdefaultencoding('utf-8')

class Theme:

    def removeFile(self, dir, postfix):
        print dir
        if os.path.isfile(dir):
            print "文件：", dir
            if os.path.basename(dir) == postfix:
                os.system("adb push " + dir + " /sdcard/PrivacyManager/theme/")
                fname = "/sdcard/PrivacyManager/theme/" + postfix
                os.system("adb shell mv " + fname + " " + fname + "_" + str(time.time()) + ".privacy")
        else:
            for file in os.listdir(dir):
                self.removeFile(dir+'/'+file, postfix)

t = Theme()
_current_path = os.getcwd().replace("\\", "/")
t.removeFile(_current_path + "/dst/zip", "app-release.apk")